<template>
    <div>
        <van-field v-model="content"
                   :label="label"
                   :type="type"
                   :placeholder="placeholder"
                   @input="handlerulg"
        />
    </div>
</template>

<script>
    export default {
        name: "LoginText",
        props: ['label','type','placeholder'],
        data(){
            return{
                content: ''
            }
        },
        methods: {
            handlerulg() {
                    this.$emit('inputChange',this.content)
                }
        },
        // watch 监听绑定数据的变化，当content发生变化时，触发函数。
        // watch:{
        //     content(){
        //         this.handlerulg()
        //     }
        // }
    }
</script>

<style scoped>

</style>